package com.softline.documentsmall.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.softline.documentsmall.entity.DictionaryKeywordConfig;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface DictionaryKeywordConfigMapper extends BaseMapper<DictionaryKeywordConfig> {

    List<DictionaryKeywordConfig> searchListByParams(@Param("id") Long id, @Param("dictionaryId") Integer dictionaryId, @Param("keyword") String keyword, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    Long getTotalCount(@Param("id") Long id, @Param("dictionaryId") Integer dictionaryId, @Param("keyword") String keyword);

    List<DictionaryKeywordConfig> searchListByKeyword(@Param("keyword") String keyword);

    void keywordUpdate(@Param("dictionaryId") Integer dictionaryId, @Param("keyword") String keyword);

    /**
     * 多语种术语搜索,根据用户输入语言，进行模糊搜索，
     *
     * @return
     * @author wph
     */
    List<Long> findByKeyword(@Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize, @Param("name") String name);

    /**
     * 根据术语ID查询相连4个关键词
     *
     * @param id
     * @return
     */
    List<Map<String, Object>> selectFourByDictionaryId(@Param("id") Integer id,@Param("name") String name);
}
